<template>
<com-main>
   <div slot="com_header">首页>权限管理>权限列表</div>
   <div slot="com_content">
   <el-table
    :data="searchlist"
    stripe
    height="380"
    style="width: 100%">
    <el-table-column
      type="index"
      label="序号"
      width="180">
    </el-table-column>
    <el-table-column
      prop="authName"
      label="权限名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="path"
      label="路径">
    </el-table-column>
    <el-table-column prop="level" label="权限级别">
      <template slot-scope="{row}">
         <el-tag v-if="row.level==0">一级</el-tag>
         <el-tag v-else-if="row.level==1" type="success">二级</el-tag>
         <el-tag v-else="row.level==2" type="warning">三级</el-tag>
      </template>
    </el-table-column>
  </el-table>
   </div>
   
</com-main>
</template>
<script>
import ComMain from '../../components/commain.vue'
import {api_rights} from '../../api/rights'
export default {
  components:{
   ComMain
  },
  data() {
   return {
      searchlist:[]
   }
  },
  mounted() {
   this.query();
  },
  methods: {
   async query(){
      let rst=await api_rights();
      let {data,meta}=rst;
      console.log(data);
       if(meta.status==200){
             this.searchlist=data;
         }

   }
  },

}
</script>
<style>
.cell{
   display: flex;
   justify-content: center;
}
.el-table .el-table__cell{
   text-align: center;
}
</style>